/*
 * @Author: zhoulf
 * @FilePath: /dg-refine-web/src/router/router.js
 * @Date: 2022-12-02 17:29:33
 * @LastEditors: fastfan
 * @LastEditTime: 2022-12-08 19:16:01
 * @Description:
 */
import Router from 'vue-router'
import { injectDefaultRoute } from '@cci/cp-frame-layout'

const originalPush = Router.prototype.push
Router.prototype.push = function push (location) {
  return originalPush.call(this, location).catch(err => err)
}
export function createRouter (layoutComponent) {
  return new Router({
    base: '/refine-web',
    mode: 'history',
    routes: [...injectDefaultRoute(layoutComponent)]
  })
}
